home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
cuj1008.zip
/
ADAMO.LIS
< prev
next >
Wrap
File List
|
1992-04-08
|
840b
|
35 lines
/*-----------------------------------------------------*
* curses_tst.c - C. Adamo 3/3/92
* Demonstrate single-character input mode using curses
*-----------------------------------------------------*/
#include <stdio.h>
#include <ctype.h>
#include <curses.h>
#define QUIT_CHAR 'q'
void main(int argc, char *argv[])
{
int key = '\0';
initscr(); /* initialize screen */
cbreak(); /* enable single char mode */
noecho(); /* disable echo mode */
while (key != QUIT_CHAR)
{
key = getch();
if (isalpha(key))
{
printf("%c\n",
islower(key) ? toupper(key)
: tolower(key));
}
}
endwin(); /* end window modes */
} /* end main() */